﻿@using OA.AspNetCore.Html;
@using OA.Model;
@using OA.Core.Model;
@model OA.Model.DB.TableInfo

@{
    ViewBag.Title = "编辑表格";
    Layout = "~/Areas/Admin/Views/Shared/_form_layout.cshtml";
}

@{

    BaseConfig config = ViewBag.BaseConfig;
    string msg = ViewBag.Msg;
    string tips = string.Empty;
    if (!string.IsNullOrWhiteSpace(msg))
    {
        tips = $"layer.msg('{msg}');";
    }


    List<ExtendField> tableFields = OA.Core.Helper.JsonHelper.DeserializeList<ExtendField>(Model.ConfigContent);
    var jisuans = tableFields.Where(m => !string.IsNullOrWhiteSpace(m.Values) && (m.Type == 68 || m.Type == 69)).ToList();
    if (jisuans.Count > 0)
    {
        Dictionary<string, string> dicReplace = new Dictionary<string, string>();
        foreach (var item in tableFields)
        {
            if (item.Type == 2 || item.Type == 21)
            {
                dicReplace.Add(item.Attribute, item.ParentName + "." + item.Name);
            }
        }
        foreach (var item in jisuans)
        {
            foreach (var key in dicReplace.Keys)
            {
                item.Values = item.Values.Replace(key, dicReplace[key]);
            }
        }
    }


    List<ListItem> customForms = ViewBag.CustomForm;
    string lastAttribute = "";
    if (tableFields.Count > 0)
    {
        lastAttribute = tableFields.Select(m => m.Attribute).OrderBy(m => m).Last();
    }
}

<style type="text/css">
    .list-group-item {
        min-height: 32px;
        cursor: pointer;
    }

    #Controls {
        background-color: #fff;
    }

    #Content .layui-form-label {
        cursor: pointer;
    }

    #Controls .list-group-item {
        font-size: 12px;
        display: block;
        min-width: 86px;
        line-height: 26px;
        position: relative;
        float: left;
        left: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 1%;
        float: left;
    }

    #Content .list-group-item {
        display: inline-block;
        width: 95%;
    }

    #Content .layui-input-block {
        width: 300px !important;
    }

    #Property .title {
        line-height: 32px;
        cursor: pointer;
    }

    .list-group-item a {
        border: 1px solid #ddd;
        color: #ffffe6 !important;
        display: block;
        cursor: move;
        font-size: 12px;
        letter-spacing: 0;
        padding-right: 4px;
    }

        .list-group-item a i {
            font-size: 16px;
            display: inline-block;
            vertical-align: middle;
            margin-bottom: 0px;
            margin-left: 6px;
            color: #808080
        }

        .list-group-item a span {
            display: inline-block;
            vertical-align: middle;
            color: #808080;
            cursor: move;
            font-size: 12px;
            letter-spacing: 0;
        }

    .myPosition {
        line-height: 42px;
        min-height: 38px;
    }

    .myPosition2, .myEmployee2 {
        clear: both;
        width: 190px;
    }

    .layui-form-checkbox[lay-skin=primary] {
        margin-bottom: 10px;
    }

    .layui-form-label {
        width: 180px !important;
    }

    .layui-input-block {
        margin-left: 210px !important;
    }
</style>

<link href="/admin/iconfont/remixicon.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="@ViewBag.OssUrl/front/webuploader/webuploader.css">
<script type="text/javascript" src="@config.OssUrl/front/webuploader/webuploader.js"></script>
<script type="text/javascript" src="@config.OssUrl/front/js/common.js"></script>
<script type="text/javascript" src="/js/department.js"></script>
<script type="text/javascript" src="/js/xm-select.js"></script>
<script type="text/javascript" src="/Admin/Home/GetXmSelectPositions"></script>
<script type="text/javascript" src="/Admin/Home/GetXmSelectEmployees"></script>
<script type="text/javascript" src="/Admin/Home/GetXmSelectDepartment"></script>
<script type="text/javascript">
    function InitPositionAndDepartment(ctl, id, name, value) {
        if (value == 0 || value == "") {
            value = employeePositions[0].p;
        }
        var d = 0;
        $.each(positions, function (i, item) {
            if (item.i == value) {
                d = item.d;
                return true;
            }
        });
        InitDepartment($("#" + ctl), d);
        InitPosition($("#" + id), d, value);
    }
    function InitEmployeeAndDepartment(ctl, id, departmentID, value) {
        if (value == 0 || value == "") {
            value = employeePositions[0].i;
            departmentID = employeePositions[0].d;
        }

        InitDepartment($("#" + ctl), departmentID);
        InitEmployee($("#" + id), departmentID, value);
    }
</script>

<div style="background-color: #fff; padding: 10px; border: 1px solid #ddd;clear:both;">
    <div style="color:red;width:600px;display:inline-block;line-height:36px;">
        <p>注：设计模式下表格纵向显示，实际使用中web端为横向显示。您可以通过预览来查看实际web端展示样式</p>
        <p>一级表头名称相同项请放置在相邻位置</p>
    </div>
    <div style="float:right;width:300px;text-align:right;display:inline-block;">
        <div style="float: left; width: 100px; height: 38px; overflow: hidden; border: 1px dotted #ddd;position:relative;" id="deleteContent">
            <i class="layui-icon layui-icon-delete" style="font-size:32px;float:left;color:red;position:absolute;top:0px;left:0px;"></i>
        </div>
        <button type="button" class="layui-btn Preview">表格预览</button>
        <button type="button" class="layui-btn layui-btn-danger saveTable">保存表格</button>
    </div>

</div>

<div class="layui-form layui-tab-content" style="padding:0px;clear:both;margin-top:4px;">
    @using (Html.BeginForm(FormMethod.Post, htmlAttributes: new { @class = "layui-form", id = "myForm" }))
    {
        @Html.AntiForgeryToken()
        <div id="Controls" style="border:1px solid #ddd;width:300px;float:left;height:747px;">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend style="font-size:13px;">基础组件</legend>
            </fieldset>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>文本框</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgbWlubGVuZ3RoPSIwIiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBbQXR0cmlidXRlXSIgdmFsdWU9IltEZWZhdWx0VmFsdWVdIiAvPg0KICAgICAgICA8L2Rpdj4NCiAgICA8L2Rpdj4=" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>数字框</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIyIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0ibnVtYmVyIiBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGlkPSJbQXR0cmlidXRlSURdIiBzdGVwPSIxIiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBbQXR0cmlidXRlXSIgdmFsdWU9IltEZWZhdWx0VmFsdWVdIiBzdHlsZT0ibWF4LXdpZHRoOjE5MHB4OyIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>Email</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgIGlkPSJkaXZfW0F0dHJpYnV0ZUlEXSI+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNiIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIG1pbmxlbmd0aD0iMCIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>手机号码</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI4MSIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIG1pbmxlbmd0aD0iMCIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>身份证</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI4MiIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIG1pbmxlbmd0aD0iMCIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>网络地址</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI4MyIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIG1pbmxlbmd0aD0iMCIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>密码框</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxOSIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InBhc3N3b3JkIiBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGlkPSJbQXR0cmlidXRlSURdIiBtaW5sZW5ndGg9IjAiIGxheS12ZXJpZnk9IltWZXJpZnldIiBhdXRvY29tcGxldGU9Im9mZiIgcGxhY2Vob2xkZXI9IltUaXBzXSIgY2xhc3M9ImxheXVpLWlucHV0IFtBdHRyaWJ1dGVdIiB2YWx1ZT0iW0RlZmF1bHRWYWx1ZV0iIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>金额</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIyMSIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9Im51bWJlciIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-bank-card-2-fill"></i>
                    <span>下拉框</span>
                    <input class="data" type="hidden" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIzIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8c2VsZWN0IG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iPg0KICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9IuaYn+acn+S4gCI+5pif5pyf5LiAPC9vcHRpb24+DQogICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0i5pif5pyf5LqMIj7mmJ/mnJ/kuow8L29wdGlvbj4NCiAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSLmmJ/mnJ/kuIkiPuaYn+acn+S4iTwvb3B0aW9uPg0KICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9IuaYn+acn+WbmyI+5pif5pyf5ZubPC9vcHRpb24+DQogICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0i5pif5pyf5LqUIj7mmJ/mnJ/kupQ8L29wdGlvbj4NCiAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSLmmJ/mnJ/lha0iPuaYn+acn+WFrTwvb3B0aW9uPg0KICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9IuaYn+acn+aXpSI+5pif5pyf5pelPC9vcHRpb24+DQogICAgICAgICAgICA8L3NlbGVjdD4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-t-box-line"></i>
                    <span>文本域</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMyIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPHRleHRhcmVhIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIGxheS12ZXJpZnk9IltWZXJpZnldIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktdGV4dGFyZWEgIFtBdHRyaWJ1dGVdIj4=" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-checkbox-line"></i>
                    <span>复选框</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgIDxsYWJlbCBjbGFzcz0ibGF5dWktZm9ybS1sYWJlbCIgZm9yPSJbQXR0cmlidXRlXSI+W05hbWVdPC9sYWJlbD4NCiAgICAgICAgICAgIDxkaXYgY2xhc3M9ImxheXVpLWlucHV0LWJsb2NrIiBpZD0iZGl2X1tBdHRyaWJ1dGVJRF0iPg0KICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMzUiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGRpdiBpZD0iW0F0dHJpYnV0ZUlEXSIgY2xhc3M9InhtLXNlbGVjdC1kZW1vIiBkYXRhLXRpcHM9IltUaXBzXSIgZGF0YS12YWx1ZXM9Ilczc2lWR1Y0ZENJNkl1YVluK2FjbitTNGdDSXNJbFpoYkhWbElqb2k1cGlmNXB5ZjVMaUFJbjBzZXlKVVpYaDBJam9pNXBpZjVweWY1THFNSWl3aVZtRnNkV1VpT2lMbW1KL21uSi9rdW93aWZWMD0iIGRhdGUtdmFsdWU9IuaYn+acn+S4gCI+PC9kaXY+ICAgICAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICA8L2Rpdj4=" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-toggle-line"></i>
                    <span>开关</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI3IiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0iY2hlY2tib3giIGlkPSJbQXR0cmlidXRlSURdIiBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGxheS1za2luPSJzd2l0Y2giIHZhbHVlPSJ0cnVlIiBsYXktdGV4dD0i5pivfOWQpiIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-calendar-2-line"></i>
                    <span>年份选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI4IiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0ibnVtYmVyIiBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGlkPSJbQXR0cmlidXRlSURdIiBkYXRhLXR5cGU9InllYXIiIGRhdGEtZm9ybWF0PSJ5eXl5IiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBteWRhdGUgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-calendar-2-line"></i>
                    <span>月份选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI5IiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0ibnVtYmVyIiBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGlkPSJbQXR0cmlidXRlSURdIiBkYXRhLXR5cGU9Im1vbnRoIiBkYXRhLWZvcm1hdD0ieXl5eU1NIiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBteWRhdGUgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-calendar-2-line"></i>
                    <span>日期选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMCIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIGRhdGEtdHlwZT0iZGF0ZSIgZGF0YS1mb3JtYXQ9Inl5eXktTU0tZGQiIGxheS12ZXJpZnk9IltWZXJpZnldIiBhdXRvY29tcGxldGU9Im9mZiIgcGxhY2Vob2xkZXI9IltUaXBzXSIgY2xhc3M9ImxheXVpLWlucHV0IG15ZGF0ZSBbQXR0cmlidXRlXSIgdmFsdWU9IltEZWZhdWx0VmFsdWVdIiBzdHlsZT0ibWF4LXdpZHRoOjE5MHB4OyIgLz4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-calendar-2-line"></i>
                    <span>时间选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMSIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIGRhdGEtdHlwZT0idGltZSIgZGF0YS1mb3JtYXQ9IkhIOm1tIiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBteWRhdGUgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-calendar-2-line"></i>
                    <span>日期时间</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMiIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iIGRhdGEtdHlwZT0iZGF0ZXRpbWUiIGRhdGEtZm9ybWF0PSJ5eXl5LU1NLWRkIEhIOm1tOnNzIiBsYXktdmVyaWZ5PSJbVmVyaWZ5XSIgYXV0b2NvbXBsZXRlPSJvZmYiIHBsYWNlaG9sZGVyPSJbVGlwc10iIGNsYXNzPSJsYXl1aS1pbnB1dCBteWRhdGUgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-upload-cloud-2-line"></i>
                    <span>文件上传</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxNiIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGRpdiBjbGFzcz0idXBsb2FkX2ZpbGVfYnRuIiBpZD0iYnRuX1tBdHRyaWJ1dGVJRF0iIHN0eWxlPSd3aWR0aDo4NnB4O2Zsb2F0OmxlZnQ7Jz7pgInmi6nmlofku7Y8L2Rpdj48ZGl2IGNsYXNzPSdpbnB1dF9kaXYnPjxpbnB1dCB0eXBlPSd0ZXh0JyBuYW1lPSdbQXR0cmlidXRlTmFtZV0nIHZhbHVlPScnIGNsYXNzPSdsYXl1aS1pbnB1dCcgbGF5LXZlcmlmeT0nJyBhdXRvY29tcGxldGU9J29mZicgLz48L2Rpdj4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin: 20px 0;clear:both;width:100%;float:left;">
                <legend style="font-size:13px;">高级组件</legend>
            </fieldset>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>部门选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMjMiIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiB2YWx1ZT0nW0NvbmZpZ0luZm9dJyBuYW1lPSJDb25maWdJbmZvIiBjbGFzcz0iQ29uZmlnSW5mbyIgLz4NCiAgICAgICAgICAgPGRpdiBpZD0iW0F0dHJpYnV0ZUlEXSIgY2xhc3M9InhtLXNlbGVjdC1kZXBhcnRtZW50IiBkYXRlLXZhbHVlPSIiPjwvZGl2Pg0KICAgICAgICA8L2Rpdj4NCiAgICA8L2Rpdj4=" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>岗位选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMjQiIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiB2YWx1ZT0nW0NvbmZpZ0luZm9dJyBuYW1lPSJDb25maWdJbmZvIiBjbGFzcz0iQ29uZmlnSW5mbyIgLz4NCiAgICAgICAgICAgPGRpdiBpZD0iW0F0dHJpYnV0ZUlEXSIgY2xhc3M9InhtLXNlbGVjdC1wb3NpdGlvbiIgZGF0ZS12YWx1ZT0iIj48L2Rpdj4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>职员选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSIxMjIiIC8+DQogICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiB2YWx1ZT0nW0NvbmZpZ0luZm9dJyBuYW1lPSJDb25maWdJbmZvIiBjbGFzcz0iQ29uZmlnSW5mbyIgLz4NCiAgICAgICAgICAgPGRpdiBpZD0iW0F0dHJpYnV0ZUlEXSIgY2xhc3M9InhtLXNlbGVjdC1lbXBsb3llZSIgZGF0ZS12YWx1ZT0iIj48L2Rpdj4NCiAgICAgICAgPC9kaXY+DQogICAgPC9kaXY+" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>往来单位</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNDEiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IG15YXR0cmlidXRlPSJbQXR0cmlidXRlXSIgdHlwZT0idGV4dCIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iIiBjbGFzcz0icmVsZXZhbmN5IGxheXVpLWlucHV0IGF1dG9jb21wbGV0ZSIgdmFsdWU9JycgZGF0YS10eXBlPSI1IiBkYXRhLW5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgZGF0YS11cmw9Ii9BZG1pbi9Ib21lL0dldFJlbGF0ZWRDb21wYW55IiAvPg0KICAgICAgICAgICAgPC9kaXY+DQogICAgICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>供应商</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNDIiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IG15YXR0cmlidXRlPSJbQXR0cmlidXRlXSIgdHlwZT0idGV4dCIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iIiBjbGFzcz0icmVsZXZhbmN5IGxheXVpLWlucHV0IGF1dG9jb21wbGV0ZSIgdmFsdWU9JycgZGF0YS10eXBlPSI1IiBkYXRhLW5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgZGF0YS11cmw9Ii9BZG1pbi9Ib21lL0dldFN1cHBsaWVyIiAvPg0KICAgICAgICAgICAgPC9kaXY+DQogICAgICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>客户</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNDMiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IG15YXR0cmlidXRlPSJbQXR0cmlidXRlXSIgdHlwZT0idGV4dCIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iIiBjbGFzcz0icmVsZXZhbmN5IGxheXVpLWlucHV0IGF1dG9jb21wbGV0ZSIgdmFsdWU9JycgZGF0YS10eXBlPSI1IiBkYXRhLW5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgZGF0YS11cmw9Ii9BZG1pbi9Ib21lL0dldEN1c3RvbWVyIiAvPg0KICAgICAgICAgICAgPC9kaXY+DQogICAgICAgIDwvZGl2Pg==" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>联系人</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNDQiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPHNlbGVjdCBuYW1lPSJbQXR0cmlidXRlTmFtZV0iIGxheS1maWx0ZXI9IltBdHRyaWJ1dGVJRF0iIGlkPSJbQXR0cmlidXRlSURdIiBjbGFzcz0ibXlDb250YWN0ICBDb250YWN0X1tEZWZhdWx0VmFsdWVdIiAgY3VycmVudHZhbHVlPScnID48L3NlbGVjdD4NCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICA8L2Rpdj4=" />
                </a>
            </div>
            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>产品选择</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iNDAiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iICBhdXRvY29tcGxldGU9Im9mZiIgcGxhY2Vob2xkZXI9IiIgY2xhc3M9ImxheXVpLWlucHV0IGF1dG9jb21wbGV0ZSIgdmFsdWU9JycgZGF0YS10eXBlPSI1IiBkYXRhLW5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgZGF0YS11cmw9Ii9BZG1pbi9Ib21lL0dldFByb2R1Y3QiIC8+DQogICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgPC9kaXY+" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>单据引用</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9ImxheXVpLWZvcm0tbGFiZWwiIGZvcj0iW0F0dHJpYnV0ZV0iPltOYW1lXTwvbGFiZWw+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBjbGFzcz0iVHlwZUlEIiB2YWx1ZT0iMzAiIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgdmFsdWU9J1tDb25maWdJbmZvXScgbmFtZT0iQ29uZmlnSW5mbyIgY2xhc3M9IkNvbmZpZ0luZm8iIC8+DQogICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgaWQ9IltBdHRyaWJ1dGVJRF0iICBhdXRvY29tcGxldGU9Im9mZiIgcGxhY2Vob2xkZXI9IiIgY2xhc3M9ImxheXVpLWlucHV0IGF1dG9jb21wbGV0ZSIgdmFsdWU9JycgZGF0YS10eXBlPSIxIiBkYXRhLW5hbWU9IltBdHRyaWJ1dGVOYW1lXSIgZGF0YS11cmw9Ii9BZG1pbi9Ib21lL0dldFJlZmVyZW5jZXMiIC8+DQogICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgPC9kaXY+" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>计算</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI2OCIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9Im51bWJlciIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>

            <div class="list-group-item">
                <a>
                    <i class="iconfont ri-input-method-line"></i>
                    <span>小计</span>
                    <input type="hidden" class="data" value="PGRpdiBjbGFzcz0ibGF5dWktZm9ybS1pdGVtIj4NCiAgICAgICAgPGxhYmVsIGNsYXNzPSJsYXl1aS1mb3JtLWxhYmVsIiBmb3I9IltBdHRyaWJ1dGVdIj5bTmFtZV08L2xhYmVsPg0KICAgICAgICA8ZGl2IGNsYXNzPSJsYXl1aS1pbnB1dC1ibG9jayIgaWQ9ImRpdl9bQXR0cmlidXRlSURdIj4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIGNsYXNzPSJUeXBlSUQiIHZhbHVlPSI2OSIgLz4NCiAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIHZhbHVlPSdbQ29uZmlnSW5mb10nIG5hbWU9IkNvbmZpZ0luZm8iIGNsYXNzPSJDb25maWdJbmZvIiAvPg0KICAgICAgICAgICAgPGlucHV0IHR5cGU9Im51bWJlciIgbmFtZT0iW0F0dHJpYnV0ZU5hbWVdIiBpZD0iW0F0dHJpYnV0ZUlEXSIgbGF5LXZlcmlmeT0iW1ZlcmlmeV0iIGF1dG9jb21wbGV0ZT0ib2ZmIiBwbGFjZWhvbGRlcj0iW1RpcHNdIiBjbGFzcz0ibGF5dWktaW5wdXQgW0F0dHJpYnV0ZV0iIHZhbHVlPSJbRGVmYXVsdFZhbHVlXSIgc3R5bGU9Im1heC13aWR0aDoxOTBweDsiIC8+DQogICAgICAgIDwvZGl2Pg0KICAgIDwvZGl2Pg==" />
                </a>
            </div>


        </div>
        <div id="Property" style="border: 1px solid #ddd; float: right; width: 250px; padding:10px; background-color: #fff; ">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend style="font-size:13px;">控件属性</legend>
            </fieldset>
            <div>
                <div class="title" title="一般为中文，如：出差中的启程">一级表头名称</div>
                <input type="text" name="ParentName" id="ParentName" value="" class="layui-input" autocomplete="off" />
            </div>
            <div>
                <div class="title" title="一般为中文，如：出差中的出发地点。如果表格只有一级，请确保一级表头名称与二级表头名称一致">二级表头名称</div>
                <input type="text" name="Name" id="Name" value="" class="layui-input" autocomplete="off" />
                <input type="hidden" value="" name="Attribute" id="Attribute" class="layui-input" autocomplete="off" />
            </div>
            <div>
                <div class="title" title="新建单据时是否显示">起草项</div>
                <input type="checkbox" name="IsDraftShow" id="IsDraftShow" lay-skin="switch" lay-filter="IsDraftShow" lay-text="是|否">
            </div>
            <div>
                <div class="title" title="汇总列">汇总列</div>
                <input type="checkbox" name="IsSummarizing" id="IsSummarizing" lay-skin="switch" lay-filter="IsSummarizing" lay-text="是|否">
            </div>
            <div class="min">
                <div class="title">最小值</div>
                <input type="number" name="Min" id="Min" class="layui-input" autocomplete="off" />
            </div>
            <div class="max">
                <div class="title" title="0为不限制">最大值</div>
                <input type="number" name="Max" id="Max" class="layui-input" autocomplete="off" />
            </div>
            <div>
                <div class="title" title="提示语">提示语</div>
                <input type="text" name="Tips" id="Tips" autocomplete="off" value="" class="layui-input" />
            </div>
            <div class="Verify">
                <div class="title" title="必填">必填</div>
                <input type="checkbox" name="IsRequired" id="IsRequired" lay-skin="switch" lay-filter="IsRequired" lay-text="是|否">
            </div>
            <div>
                <div class="title" title="默认值">默认值</div>
                <input type="text" name="DefaultValue" id="DefaultValue" autocomplete="off" value="" class="layui-input" />
            </div>
            <div>
                <div class="title" title="数据源">数据源</div>
                <input type="text" name="Values" id="Values" value="" autocomplete="off" class="layui-input" />
            </div>
            <div style="display:none" id="relevancyDiv">
                <div class="title" title="关联往来单位控件">关联往来单位控件</div>
                <select id="relevancy" lay-filter="relevancy">
                </select>
            </div>
            <div style="display:none" id="referenceDiv">
                <div class="title" title="引用类型">引用类型</div>
                <select id="reference" lay-filter="reference">
                    @foreach (var item in customForms)
                    {
                        <option value="@item.Value">@item.Text</option>
                    }
                </select>
            </div>
            <div id="dataScoreDiv">
                <div class="title" title="数据项">数据项</div>
                <div id="dataScore">

                </div>
            </div>
        </div><div id="Content" style=" border: 1px solid #ddd; min-height:707px;padding:20px;margin-left:310px;margin-right:280px;background-color:#fff; ">
            @foreach (var item in tableFields)
            {
                string tempID = "div_dicExtend" + item.Attribute;
                <div class="list-group-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label" for="@item.Attribute">@item.ParentName / @item.Name</label>
                        <div class="layui-input-block" id="@tempID">
                            <input type="hidden" class="TypeID" value="@item.Type">
                            <input type="hidden" value=@OA.Core.Helper.JsonHelper.SerializeObject(item) name="ConfigInfo" class="ConfigInfo">

                            @Html.Raw(MvcHtmlExtension.GetMyEditorControl(item, "dicExtend"))


                        </div>
                    </div>
                </div>
            }
        </div>
    }
</div>
<script type="text/javascript">
    var itemInfo = {
        "IsDraftShow": true,//是否是起草项
        "IsSummarizing": false,//汇总列
        "ParentName": "",//上级名称，表格
        "Name": "文本",//名称
        "Attribute": "_Text",//属性名称 对应表单中的Name
        "Type": 1,//类型
        "Min": 0,
        "Max": 0,
        "Tips": "请输入文本",
        "IsRequired": true,
        "DefaultValue": "",
        "Values": "",
        "Status": 1,
        "Sort": 0,
        "Value": "",
        "Text": "",
        "DbScore": null,//数据源
        "ThirdPartyDataSource": null,//第三方数据源
        "AttributeName": null,
        "AttributeID": null
    };
    $(".Preview").click(function () {
        var infos=[];
        $("#Content .ConfigInfo").each(function (index, item) {
            infos.push($.parseJSON($(item).val()));
        });
        $.ajax({
            type: 'POST',
            url: '/Admin/TableInfo/ShowPreview',//发送请求
            traditional: true,
            data: { infos: JSON.stringify(infos) },
            dataType: "html",
            success: function (result) {
                var htmlCont = result;
                layer.open({
                    type: 1,
                    title: '表格预览',
                    shadeClose: false,
                    area: ['90%', '90%'],
                    content: htmlCont
                });
                form.render();
            }
        });
    });
    $(".saveTable").click(function () {
        var infos = [];
        $("#Content .ConfigInfo").each(function (index, item) {
            infos.push($.parseJSON($(item).val()));
        });
        $.ajax({
            type: 'POST',
            url: '/Admin/TableInfo/SaveTable',//发送请求
            traditional: true,
            data: { id:@Model.ID, infos: JSON.stringify(infos) },
            dataType: "json",
            success: function (result) {
                if (result.State == 200) {
                    layer.msg("表单保存成功!");
                }
                else {
                    layer.msg(result.Msg);
                }
            }
        },'json');

    });
    $("#Property #Name").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.Name = value;
        obj.parent().find(".layui-form-label").html(jsonInfo.ParentName + " / " + value);
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
    });

    $("#Property #ParentName").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.ParentName = value;
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        obj.parent().find(".layui-form-label").html(value + " / " + jsonInfo.Name);
    });


    $("#Property #Min").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.Min = value;
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        obj.prop("min", value);
    });

    $("#Property #Max").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.Max = value;
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        obj.prop("max", value);
    });

    $("#Property #Tips").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.Tips = value;
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        obj.prop("placeholder", value);

    });

    $("#Property #DefaultValue").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.DefaultValue = value;
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        if (obj.val() == "") { obj.val(value); }
    });

    $("#Property #Values").on('input', function (e) {
        var value = e.delegateTarget.value;
        var attribute = $(this).parent().parent().find("#Attribute").val();
        var obj = $("#Content " + "#div_dicExtend" + attribute);
        var jsonStr = obj.find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        jsonInfo.Values = value
        obj.find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        if (jsonInfo.Type == 3) {
            var items = value.split(/[, ，]/);
            var html = "";
            for (var i = 0; i < items.length; i++) {
                html += "<option value='" + items[i] + "'>" + items[i] + "</option>";
            }
            obj.find("select").html(html);
            form.render();
        }
        else if (jsonInfo.Type == 4) {
            var items = value.split(/[, ，]/);
            var html = "";
            for (var i = 0; i < items.length; i++) {
                html += "<input type='radio' name='dicExtend" + attribute + "' value='" + items[i] + "' title='" + items[i] + "' />";
            }
            obj.find(":radio").remove();
            obj.find(".layui-form-radio").remove();
            obj.append(html);
            form.render();
        }
        else if (jsonInfo.Type == 5) {
            var items = value.split(/[, ，]/);
            var html = "";
            for (var i = 0; i < items.length; i++) {
                html += "<input type='checkbox' name='dicExtend" + attribute + "' value='" + items[i] + "' title='" + items[i] + "' lay-skin='primary' />";
            }
            obj.find(":checkbox").remove();
            obj.find(".layui-form-checkbox").remove();
            obj.append(html);
            form.render();
        }

    });


    $("#Content").on('click', '.layui-form-label', function () {
        var jsonStr = $(this).parent().find(".ConfigInfo").val();
        var jsonInfo = $.parseJSON(jsonStr);
        $("#Property #Name").val(jsonInfo.Name);
        $("#Property #ParentName").val(jsonInfo.ParentName);
        $("#Property #Attribute").val(jsonInfo.Attribute);

        $("#Property #Tips").val(jsonInfo.Tips);

        $("#Property #IsDraftShow").prop("checked", jsonInfo.IsDraftShow);
        $("#Property #IsSummarizing").prop("checked", jsonInfo.IsSummarizing);
        $("#Property #IsRequired").prop("checked", jsonInfo.IsRequired);

        $("#Property #DefaultValue").val(jsonInfo.DefaultValue);
        $("#Property #Values").val(jsonInfo.Values);
        if (jsonInfo.IsRequired) {
            $("#Property #IsRequired").prop("checked", true);
        }
        if (jsonInfo.Type == 2 || jsonInfo.Type == 21) {
            $("#Property .min .title").html("最小值");
            $("#Property .max .title").html("最大值");

        }
        else if (jsonInfo.Type == 17) {
            $("#Property .min .title").html("最少上传图片数");
            $("#Property .max .title").html("最多上传图片数");

        }
        else if (jsonInfo.Type == 18) {
            $("#Property .min .title").html("最少上传文件数");
            $("#Property .max .title").html("最多上传文件数");

        }
        else if (jsonInfo.Type == 68 || jsonInfo.Type == 69) {
            layer.msg("请在数据源处填写计算格式");

        }
        else {
            $("#Property .min .title").html("最小长度");
            $("#Property .max .title").html("最大长度");
        }

        $("#Property #Min").val(jsonInfo.Min);
        $("#Property #Max").val(jsonInfo.Max);
        if (jsonInfo.Type == 44) {
            $("#relevancyDiv").css("display", "block");
            var html = "<option>请选择</option>";
            $("#Content .ConfigInfo").each(function (index, item) {

                var jsonInfo2 = $.parseJSON($(item).val());
                if (jsonInfo2.Type == 41 || jsonInfo2.Type == 42 || jsonInfo2.Type == 43) {
                    if (jsonInfo2.Attribute == jsonInfo.DefaultValue) {
                        html += "<option value='" + jsonInfo2.Attribute + "'selected >" + jsonInfo2.Name + "</option>";
                    }
                    else {
                        html += "<option value='" + jsonInfo2.Attribute + "'>" + jsonInfo2.Name + "</option>";
                    }
                }
            });
            $("#relevancy").html(html);


            form.on('select(relevancy)', function (data) {
                var value = data.value;
                var attribute = $(data.elem).parent().parent().find("#Attribute").val();
                var obj = $("#Content " + "#dicExtend" + attribute);
                var jsonStr = obj.parent().parent().find(".ConfigInfo").val();
                var jsonInfo = $.parseJSON(jsonStr);
                if (jsonInfo.Type == 44) {
                    jsonInfo.DefaultValue = value
                    obj.parent().parent().find(".ConfigInfo").val(JSON.stringify(jsonInfo));
                    $(data.elem).parent().parent().find("#DefaultValue").val(value);
                }
            });
        }
        else {
            $("#relevancyDiv").css("display", "none");
        }

        if (jsonInfo.Type == 30 || jsonInfo.Type == 31) {
            $("#referenceDiv").css("display", "block");
            $("#reference").val(jsonInfo.Values);
            form.on('select(reference)', function (data) {
                var value = data.value;
                var attribute = $(data.elem).parent().parent().find("#Attribute").val();
                var obj = $("#Content " + "#dicExtend" + attribute);
                var jsonStr = obj.parent().parent().find(".ConfigInfo").val();
                var jsonInfo = $.parseJSON(jsonStr);
                if (jsonInfo.Type == 30 || jsonInfo.Type == 31) {
                    jsonInfo.Values = value
                    obj.parent().parent().find(".ConfigInfo").val(JSON.stringify(jsonInfo));
                    $(data.elem).parent().parent().find("#Values").val(value);
                }
            });
        }
        else {
            $("#referenceDiv").css("display", "none");
        }

        if (jsonInfo.Type == 68 || jsonInfo.Type == 69) {
            var dataScore = "";
            var defaultXiaoJi = "";
            $("#Content .ConfigInfo").each(function (index, item) {
                var itemInfo = $.parseJSON($(item).val());
                if (itemInfo.Type == 21) {
                    dataScore += "<p>" + itemInfo.ParentName + "." + itemInfo.Name + "</p>";
                    if (defaultXiaoJi != "") { defaultXiaoJi += "+"; }
                    defaultXiaoJi += itemInfo.ParentName + "." + itemInfo.Name;
                }
            });
            if (jsonInfo.Values == "" || jsonInfo.Values == null || jsonInfo.Values == undefined) {
                jsonInfo.Values = defaultXiaoJi;
                $("#Property #Values").val(jsonInfo.Values);
            }
            $("#dataScoreDiv").css("display","block");
            $("#dataScore").html(dataScore);
        }
        else {
            $("#dataScoreDiv").css("display", "none");
            $("#dataScore").html("");
        }

        form.render();

    });
</script>
<script type="text/javascript" src="~/js/base64.min.js"></script>
<script type="text/javascript" src="~/js/Sortable.js"></script>
<script type="text/javascript">
    var keys = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
    var index = 0;
    var lastAttribute = "@lastAttribute";
    if (lastAttribute != "") {
        lastAttribute = lastAttribute.substring(2);
        if (lastAttribute.length == 1) {
            for (var i = 0; i < keys.length; i++) {
                if (keys[i] == lastAttribute) {
                    index = i + 1;
                }
            }
        }
        else if (lastAttribute.length == 2) {
            var tens = 0;
            var units = 0;
            for (var i = 0; i < keys.length; i++) {
                if (keys[i] == lastAttribute[0]) {
                    tens = i;
                }
            }
            for (var i = 0; i < keys.length; i++) {
                if (keys[i] == lastAttribute[1]) {
                    units = i;
                }
            }
            index = (tens + 1) * 10 + units;
        }
    }
    new Sortable(deleteContent, {
        group: 'shared',
        animation: 150,

    });
    new Sortable(Controls, {
        group: {
            name: 'shared',
            pull: 'clone',
            put: false,
        },
        animation: 150,
        sort: false,
        onEnd: function (evt) {
            if ($(evt.to).prop("id") == "Content" && $(evt.from).prop("id") == "Controls") {
                var origEl = evt.item;
                var cloneEl = evt.clone;
                var base64Info = $(cloneEl).find(".data").val();
                var contolInfo = Base64.decode(base64Info);
                var myJson = itemInfo;
                myJson.Tips = "";
                myJson.Values = "";
                var dataType = $(contolInfo).find(".TypeID").val();
                myJson.Type = dataType;
                if (index <= 25) {
                    myJson.Attribute = "__" + keys[index];
                    myJson.AttributeName = "dicExtend." + keys[index];
                    myJson.AttributeID = "dicExtend__" + keys[index];
                }
                else {
                    var i = index % 26;
                    var j = parseInt(index / 26) - 1;
                    myJson.Attribute = "__" + keys[j] + keys[i];
                    myJson.AttributeName = "dicExtend." + keys[j] + keys[i];
                    myJson.AttributeID = "dicExtend__" + keys[j] + keys[i];
                }
                if (dataType == 1) {
                    myJson.Name = "文本框";
                    myJson.ParentName = "文本框";
                }
                else if (dataType == 2) {
                    myJson.Name = "数字框";
                    myJson.ParentName = "数字框";
                }
                else if (dataType == 3) {
                    myJson.Name = "文字下拉框";
                    myJson.ParentName = "文字下拉框";
                    myJson.Values = "星期一,星期二,星期三,星期四,星期五,星期六,星期日";
                }
                else if (dataType == 4) {
                    myJson.Name = "单选框";
                    myJson.ParentName = "单选框";
                    myJson.Values = "星期一,星期二";
                }
                else if (dataType == 5) {
                    myJson.Name = "复选框";
                    myJson.ParentName = "复选框";
                    myJson.Values = "星期一,星期二";
                }
                else if (dataType == 6) {
                    myJson.Name = "Email";
                    myJson.ParentName = "Email";
                    myJson.Tips = "请输入Email";
                }
                else if (dataType == 7) {
                    myJson.Name = "开关";
                    myJson.ParentName = "开关";
                }
                else if (dataType == 8) {
                    myJson.Name = "年份选择器";
                    myJson.ParentName = "年份选择器";
                }
                else if (dataType == 9) {
                    myJson.Name = "月份选择器";
                    myJson.ParentName = "月份选择器";
                }
                else if (dataType == 10) {
                    myJson.Name = "日期选择器";
                    myJson.ParentName = "日期选择器";
                }
                else if (dataType == 11) {
                    myJson.Name = "时间选择器";
                    myJson.ParentName = "时间选择器";
                }
                else if (dataType == 12) {
                    myJson.Name = "日期时间";
                    myJson.ParentName = "日期时间";
                }
                else if (dataType == 15) {
                    myJson.Name = "单图片上传";
                    myJson.ParentName = "单图片上传";
                    myJson.Verify = "";
                }
                else if (dataType == 16) {
                    myJson.Name = "单文件上传";
                    myJson.ParentName = "单文件上传";
                    myJson.Verify = "";
                }
                else if (dataType == 17) {
                    myJson.Name = "多图片上传";
                    myJson.ParentName = "多图片上传";
                    myJson.Verify = "";
                }
                else if (dataType == 18) {
                    myJson.Name = "多文件上传";
                    myJson.ParentName = "多文件上传";
                    myJson.Verify = "";
                }
                else if (dataType == 19) {
                    myJson.Name = "密码框";
                    myJson.ParentName = "密码框";
                }
                else if (dataType == 21) {
                    myJson.Name = "金额";
                    myJson.ParentName = "金额";
                }
                else if (dataType == 22 || dataType == 122) {
                    myJson.Name = "职员";
                    myJson.ParentName = "职员";
                }
                else if (dataType == 23 || dataType == 123) {
                    myJson.Name = "部门";
                    myJson.ParentName = "部门";
                }
                else if (dataType == 24 || dataType == 124) {
                    myJson.Name = "岗位";
                    myJson.ParentName = "岗位";
                }
                else if (dataType == 30) {
                    myJson.Name = "单据引用";
                    myJson.ParentName = "单据引用";
                }
                else if (dataType == 31) {
                    myJson.Name = "多单据引用";
                    myJson.ParentName = "多单据引用";
                }
                else if (dataType == 40) {
                    myJson.Name = "产品选择";
                    myJson.ParentName = "产品选择";
                }
                else if (dataType == 41) {
                    myJson.Name = "往来单位";
                    myJson.ParentName = "往来单位";
                }
                else if (dataType == 42) {
                    myJson.Name = "供应商";
                    myJson.ParentName = "供应商";
                }
                else if (dataType == 43) {
                    myJson.Name = "客户";
                    myJson.ParentName = "客户";
                }
                else if (dataType == 44) {
                    myJson.Name = "联系人";
                    myJson.ParentName = "联系人";
                }
                else if (dataType == 68) {
                    myJson.Name = "计算";
                    myJson.ParentName = "计算";

                }
                else if (dataType == 69) {
                    myJson.Name = "小计";
                    myJson.ParentName = "小计";
                }
                else if (dataType == 81) {
                    myJson.Name = "手机号码";
                    myJson.ParentName = "手机号码";
                }
                else if (dataType == 82) {
                    myJson.Name = "身份证";
                    myJson.ParentName = "身份证";
                }
                else if (dataType == 83) {
                    myJson.Name = "网络地址";
                    myJson.ParentName = "网络地址";
                }
                else if (dataType == 135) {
                    myJson.Name = "多选";
                    myJson.ParentName = "多选";
                    myJson.Values = "星期一,星期二";
                }
                contolInfo = contolInfo.replaceAll("[Name]", myJson.ParentName + " / " + myJson.Name);
                for (var key in myJson) {
                    contolInfo = contolInfo.replaceAll("[" + key + "]", myJson[key]);
                }
                contolInfo = contolInfo.replaceAll("[ConfigInfo]", JSON.stringify(myJson));
                origEl.innerHTML = contolInfo;
                index++;

                if (dataType == 8 || dataType == 9 || dataType == 10 || dataType == 11 || dataType == 12) {
                    var format = 'yyyy';
                    var type = 'year';
                    var showBottom = false;
                    if (dataType == 9) {
                        format = 'yyyyMM';
                        type = 'month'
                    }
                    else if (dataType == 10) {
                        format = 'yyyy-MM-dd';
                        type = 'date'
                    }
                    else if (dataType == 11) {
                        format = 'HH:mm';
                        type = 'time';
                        showBottom = true;
                    }
                    else if (dataType == 12) {
                        format = 'yyyy-MM-dd HH:mm:ss';
                        type = 'datetime';
                        showBottom = true;
                    }
                    laydate.render({
                        elem: '#' + myJson.AttributeID,
                        type: type,
                        showBottom: true,//没有下方的取消和确定按钮
                        format: format,

                    });
                }
                else if (dataType == 15) {
                    UpLoadImageObj("btn_" + myJson.AttributeID, false);
                }
                else if (dataType == 16) {
                    UpLoadFlieObj(myJson.AttributeID, "btn_" + myJson.AttributeID, false);
                }
                else if (dataType == 17) {
                    UpLoadImageObj("btn_" + myJson.AttributeID, true);
                }
                else if (dataType == 18) {
                    UpLoadFlieObj(myJson.AttributeID, "btn_" + myJson.AttributeID, true);
                }
                else if (dataType == 23 || dataType == 24 || dataType == 22) {
                    form.on('select(Department)', function (data) {
                        var name = $(data.elem).prop("name");
                        var currentDepartmentID = data.value;
                        if (currentDepartmentID == 0 && $(data.elem).parent().prev().find("select").length == 1) {
                            currentDepartmentID = $(data.elem).parent().prev().find("select").val();
                        }
                        var employeeObj = $(data.elem).parent().parent().parent().find(".myEmployee2 select");

                        if (employeeObj.length > 0) {
                            $(employeeObj[0]).html("<option value=''>请选择<option>");
                            InitEmployee($(employeeObj[0]), currentDepartmentID, "");
                        }

                        var positionObj = $(data.elem).parent().parent().parent().find(".myPosition2 select");
                        if (positionObj.length > 0) {
                            InitPosition($(positionObj[0]), currentDepartmentID, 0);
                        }
                        InitDepartment($(data.elem).parent().parent(), data.value, name);
                        form.render('select');
                    });
                    if (dataType == 23) {
                        InitDepartment($("#Department_" + myJson.AttributeID), '', myJson.AttributeName);
                    }
                    else if (dataType == 24) {
                        InitPositionAndDepartment('Department_' + myJson.AttributeID, myJson.AttributeID, myJson.AttributeName, '');
                    }
                    else if (dataType == 22) {
                        InitEmployeeAndDepartment('Department_' + myJson.AttributeID, myJson.AttributeID, '0', '');
                    }

                }
                form.render();
                InintTable();
            }
            else if ($(evt.to).prop("id") == "deleteContent" && $(evt.from).prop("id") == "Controls") {
                var origEl = evt.item;
                var cloneEl = evt.clone;
                origEl.innerHTML = '';
            }
        },

    });

    new Sortable(Content, {
        group: 'shared',
        animation: 150,
        onEnd: function (evt) {
            if ($(evt.to).prop("id") == "deleteContent" && $(evt.from).prop("id") == "Content") {
                var origEl = evt.item;
                var cloneEl = evt.clone;
                origEl.innerHTML = '';
            }
        },
    });

</script>
<script type="text/javascript">
    layui.use(['form'], function () {
        form = layui.form;
        form.on('switch(IsDraftShow)', function (data) {
            var attribute = $(data.elem).parent().parent().find("#Attribute").val();
            var obj = $("#Content " + "#dicExtend" + attribute);
            var jsonStr = obj.parent().parent().find(".ConfigInfo").val();
            var jsonInfo = $.parseJSON(jsonStr);
            if (data.elem.checked) {
                jsonInfo.IsDraftShow = true;
            }
            else {
                jsonInfo.IsDraftShow = false;
            }
            obj.parent().parent().find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        });

        form.on('switch(IsSummarizing)', function (data) {
            var attribute = $(data.elem).parent().parent().find("#Attribute").val();
            var obj = $("#Content " + "#dicExtend" + attribute);
            var jsonStr = obj.parent().parent().find(".ConfigInfo").val();
            var jsonInfo = $.parseJSON(jsonStr);
            if (jsonInfo.Type != 21 && jsonInfo.Type != 2) {
                layer.msg("汇总列只对数字列和金额列有效");
                return;
            }
            if (data.elem.checked) {
                jsonInfo.IsSummarizing = true;
            }
            else {
                jsonInfo.IsSummarizing = false;
            }
            obj.parent().parent().find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        });

        form.on('switch(IsRequired)', function (data) {
            var attribute = $(data.elem).parent().parent().find("#Attribute").val();
            var obj = $("#Content " + "#dicExtend" + attribute);
            var jsonStr = obj.parent().parent().find(".ConfigInfo").val();
            var jsonInfo = $.parseJSON(jsonStr);
            if (data.elem.checked) {
                jsonInfo.IsRequired = true;
            }
            else {
                jsonInfo.IsRequired = false;
            }
            obj.parent().parent().find(".ConfigInfo").val(JSON.stringify(jsonInfo));
        });

        form.on('select(Department)', function (data) {
            var name = $(data.elem).prop("name");
            var currentDepartmentID = data.value;
            if (currentDepartmentID == 0 && $(data.elem).parent().prev().find("select").length == 1) {
                currentDepartmentID = $(data.elem).parent().prev().find("select").val();
            }
            var employeeObj = $(data.elem).parent().parent().parent().find(".myEmployee2 select");

            if (employeeObj.length > 0) {
                $(employeeObj[0]).html("<option value=''>请选择<option>");
                InitEmployee($(employeeObj[0]), currentDepartmentID, "");
            }

            var positionObj = $(data.elem).parent().parent().parent().find(".myPosition2 select");
            if (positionObj.length > 0) {
                InitPosition($(positionObj[0]), currentDepartmentID, 0);
            }
            InitDepartment($(data.elem).parent().parent(), data.value, name);
            form.render('select');
        });
    });
</script>
<script type="text/javascript">
    function InintTable() {
        $(".xm-select-demo").each(function (index, item) {
            if ($(item).html() == "") {
                var base64Info = $(item).attr("data-values");
                var selects = $(item).attr("data-value");
                var tips = $(item).attr("data-tips");
                var my_id = $(item).prop("id");
                var str = Base64.decode(base64Info);
                var list = JSON.parse(str);
                var currentValues = [];
                if (selects != null && selects.length > 0) { currentValues = selects.split(","); }
                var mydata = [];
                $.each(list, function (index, item) {
                    if (currentValues != null && currentValues.length > 0 && currentValues.indexOf(item.Value) > -1) {
                        mydata.push({ name: item.Text, value: item.Value, selected: true });
                    }
                    else {
                        mydata.push({ name: item.Text, value: item.Value, selected: false });
                    }
                });
                xmSelect.render({
                    el: '#' + my_id,
                    tips: tips,
                    data: mydata,
                    model: {
                        label: {
                            type: 'text',
                            block: {
                                showCount: 1,
                                showIcon: false,
                            }
                        }
                    },
                })
            }
        });

        $(".xm-select-department").each(function (index, item) {
            if ($(item).html() == "") {
                var selects = $(item).attr("data-value");
                var currentValues = [];
                if (selects != null && selects.length > 0) { currentValues = selects.split(","); }
                var tips = $(item).attr("data-tips");
                var my_id = $(item).prop("id");
                xmSelect.render({
                    el: '#' + my_id,
                    tips: tips,
                    initValue: currentValues,
                    data: xmSelectDepartment,
                    filterable: true,
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        showFolderIcon: true,
                        showLine: true,
                        indent: 20,
                        expandedKeys: true,
                        strict: false
                    },
                    model: {
                        label: {
                            type: 'text',
                            block: {
                                showCount: 1,
                                showIcon: false,
                            }
                        }
                    },
                })
            }
        });

        $(".xm-select-employee").each(function (index, item) {
            if ($(item).html() == "") {
                var selects = $(item).attr("data-value");
                var currentValues = [];
                if (selects != null && selects.length > 0) { currentValues = selects.split(","); }
                var tips = $(item).attr("data-tips");
                var my_id = $(item).prop("id");
                xmSelect.render({
                    el: '#' + my_id,
                    tips: tips,
                    initValue: currentValues,
                    data: xmSelectEmployee,
                    toolbar: { show: true },
                    filterable: true,
                    autoRow: true,
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        showFolderIcon: true,
                        showLine: true,
                        indent: 20,
                        expandedKeys: true,
                        strict: true
                    },
                    model: {
                        label: {
                            type: 'text',
                            block: {
                                showCount: 1,
                                showIcon: false,
                            }
                        }
                    },
                })
            }
        });

        $(".xm-select-position").each(function (index, item) {
            if ($(item).html() == "") {
                var selects = $(item).attr("data-value");
                var currentValues = [];
                if (selects != null && selects.length > 0) { currentValues = selects.split(","); }
                var tips = $(item).attr("data-tips");
                var my_id = $(item).prop("id");
                xmSelect.render({
                    el: '#' + my_id,
                    tips: tips,
                    initValue: currentValues,
                    data: xmSelectPositions,
                    toolbar: { show: true },
                    filterable: true,
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        showFolderIcon: true,
                        showLine: true,
                        indent: 20,
                        expandedKeys: true,
                        strict: true
                    },
                    model: {
                        label: {
                            type: 'text',
                            block: {
                                showCount: 1,
                                showIcon: false,
                            }
                        }
                    },
                })
            }
        });
    }
    InintTable();
</script>